package org.act.xservices.rt.xcontainer.service.worker;

import org.act.xservices.rt.xcontainer.framework.IConnector;
import org.act.xservices.rt.xcontainer.framework.dispatcher.ADispatchWorkerFactory;
import org.act.xservices.rt.xcontainer.framework.dispatcher.ISafeDispatchWorker;
import org.act.xservices.rt.xcontainer.inf.context.IServiceContext;
import org.act.xservices.rt.xcontainer.service.handler.ServiceValidationHandler;

/**
 * @LastModifyTime 2008-7-7
 * @CreationTime 2007-06-20
 * @author Lizq [lizq@act.buaa.edu.cn]
 * @since JDK1.5
 */
public class ServiceOutWorkerFactory extends ADispatchWorkerFactory<IServiceContext>{

	
	private ServiceValidationHandler servicePoolHandler;
	
	
	
	@SuppressWarnings("unchecked")
	public ServiceOutWorkerFactory(IConnector connector){
		super(connector);
	}
	
	
	
	@SuppressWarnings("unchecked")
	@Override
	public ISafeDispatchWorker createSafeDispatchWorker(IServiceContext serviceContext) {
		ServiceOutWorker serviceOutWorker = new ServiceOutWorker(
				this.getConnector());
		serviceOutWorker.setServiceContext(serviceContext);
		serviceOutWorker.setServicePoolHandler(servicePoolHandler);

		return serviceOutWorker;
	}



	public ServiceValidationHandler getServicePoolHandler() {
		return servicePoolHandler;
	}



	public void setServicePoolHandler(ServiceValidationHandler servicePoolHandler) {
		this.servicePoolHandler = servicePoolHandler;
	}





}
